import 'package:appflutterhomeschool/res/styles.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

///用户： ninetailedfox
///时间： 2020/6/19
///邮箱： 1037438704@qq.com
///功能： 已读未读item展示

class StatusItemWidget extends StatelessWidget {
  final GestureTapCallback onTap;
  final Widget rightWidget;
  final String title,imageUrl;

  StatusItemWidget({this.onTap,this.rightWidget,this.title,this.imageUrl});

  @override
  Widget build(BuildContext context) {
    double widthDouble = ScreenUtil().setWidth(77);
    return Container(
      decoration: BoxDecoration(
        border: Border(bottom: BorderSide(color: Colors.grey[200],width: 0.5))
      ),
      child: ListTile(
        leading:CircleAvatar(
//头像半径
          radius: widthDouble/2,
//头像图片 -> NetworkImage网络图片，AssetImage项目资源包图片, FileImage本地存储图片
          backgroundImage: NetworkImage(
              imageUrl??'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1592526123952&di=617208aa21705cc816c70c8746a90a0b&imgtype=0&src=http%3A%2F%2F00.minipic.eastday.com%2F20170508%2F20170508111114_6b745c873b28666878d3746428c01a2d_6.jpeg'),
        ),
        title: Text(title??"姓名",
            style: TextStyles.textDark37,
            maxLines: 1,
            overflow: TextOverflow.ellipsis),
        trailing: rightWidget,
        onTap: onTap,
      ),
    );
  }
}
